package com.bw.patrol.net

import androidx.lifecycle.MutableLiveData
import com.bw.common.vm.BaseViewModel
import com.bw.http.utils.zgr.OkHttpClientManager
import com.bw.patrol.entity.PatrolEntity

class PatrolViewModel:BaseViewModel() {

    val patrolSuccess by lazy { MutableLiveData<List<PatrolEntity>>() }

    val apiService: ApiService = OkHttpClientManager.retrofitInstance.create(ApiService::class.java)

    fun getPatrol() {

        executeNetwork(
            { apiService.getPatrol() },
            patrolSuccess::postValue
        )
    }

}